package cn.HuanG.base.controller;

import cn.HuanG.base.service.ICodeService;
import cn.HuanG.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/code")
public class CodeController {

    @Autowired
    private ICodeService codeService;

    @PostMapping("/sendCode")
    public AjaxResult sendCode(@RequestBody  Map<String,String> map ){
        try{
            codeService.sendCode(map);
            return AjaxResult.me();
        }catch (Exception e){
            e.printStackTrace();
            return AjaxResult.me().setMessage(e.getMessage());
        }
    }
}
